<template>
  <div class="app-container calendar-list-container">
    <div class="filter-container">
      <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="支付宝账户ID" v-model.trim="cardQuery.userId"> </el-input>
      <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item" placeholder="城市" v-model.trim="cardQuery.city"> </el-input>
      <el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
      <el-button class="filter-item" v-if="cardQueryManager_btn_add" style="margin-left: 10px;" @click="handleCreate" type="primary" icon="edit">添加</el-button>
    </div>
    <el-table :key='tableKey' :data="list" v-loading.body="listLoading" border fit highlight-current-row style="width: 100%">
        <el-table-column
        type="index" label="序号"  header-align="center" align="center" width="65">
        <template scope="scope"><span>{{scope.$index+(cardQuery.page - 1) * cardQuery.limit + 1}} </span></template>
    </el-table-column>
      <el-table-column align="center" label="id" width="65" v-if="false">
      <template scope="scope">
        <span>{{scope.row.id}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="业务操作凭证">
      <template scope="scope">
        <span>{{scope.row.outOrderNo}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="城市">
      <template scope="scope">
        <span>{{scope.row.city}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="城市编码">
      <template scope="scope">
        <span>{{scope.row.cityCode}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="渠道">
      <template scope="scope">
        <span>{{scope.row.channel}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="支付宝账户ID">
      <template scope="scope">
        <span>{{scope.row.userId}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="证件类型">
      <template scope="scope">
        <span>{{scope.row.userCardType}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="证件号码">
      <template scope="scope">
        <span>{{scope.row.userCardNo}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="用户实名">
      <template scope="scope">
        <span>{{scope.row.realName}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="银行卡账号">
      <template scope="scope">
        <span>{{scope.row.bankCardNo}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="外部 医保卡号">
      <template scope="scope">
        <span>{{scope.row.medicalCardNo}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="监护人卡信息">
      <template scope="scope">
        <span>{{scope.row.relationCard}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="延伸参数">
      <template scope="scope">
        <span>{{scope.row.extendParams}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="请求时间">
      <template scope="scope">
        <span>{{scope.row.reqTime}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回时间">
      <template scope="scope">
        <span>{{scope.row.resultTime}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回状态">
      <template scope="scope">
        <span>{{scope.row.resultStats}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回码">
      <template scope="scope">
        <span>{{scope.row.resultCode}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回信息">
      <template scope="scope">
        <span>{{scope.row.resultMessage}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回描述">
      <template scope="scope">
        <span>{{scope.row.resultDescription}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回医疗证号">
      <template scope="scope">
        <span>{{scope.row.resultMedicalCardId}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回外部医保卡号">
      <template scope="scope">
        <span>{{scope.row.resultMedicalCardNo}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回外部医保卡有效期">
      <template scope="scope">
        <span>{{scope.row.resultMedicalCardValidateDate}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回外部医保卡状态">
      <template scope="scope">
        <span>{{scope.row.resultMedicalCardStatus}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回外部医保卡类型">
      <template scope="scope">
        <span>{{scope.row.resultMedicalCardType}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回银行卡号">
      <template scope="scope">
        <span>{{scope.row.resultBankCardNo}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回外部用户账户">
      <template scope="scope">
        <span>{{scope.row.resultOutUserAccount}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回外部用户ID">
      <template scope="scope">
        <span>{{scope.row.resultOutUserId}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回用户实名">
      <template scope="scope">
        <span>{{scope.row.resultOutRealName}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回外部用户卡类型">
      <template scope="scope">
        <span>{{scope.row.resultOutUserCardType}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回外部用户卡号">
      <template scope="scope">
        <span>{{scope.row.resultOutUserCardNo}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回社保卡账号">
      <template scope="scope">
        <span>{{scope.row.resultSocialCardNo}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="结果返回延伸参数">
      <template scope="scope">
        <span>{{scope.row.resultExtendParams}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="flg1">
      <template scope="scope">
        <span>{{scope.row.flg1}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="flg2">
      <template scope="scope">
        <span>{{scope.row.flg2}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="flg3">
      <template scope="scope">
        <span>{{scope.row.flg3}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="flg4">
      <template scope="scope">
        <span>{{scope.row.flg4}}</span>
      </template>
    </el-table-column>
        <el-table-column width="200px" align="center" label="flg5">
      <template scope="scope">
        <span>{{scope.row.flg5}}</span>
      </template>
    </el-table-column>
        <el-table-column fixed="right" align="center" label="操作" width="150"> <template scope="scope">
        <el-button v-if="cardQueryManager_btn_edit" size="small" type="success" @click="handleUpdate(scope.row)">编辑
        </el-button>
        <el-button v-if="cardQueryManager_btn_del" size="small" type="danger" @click="handleDelete(scope.row)">删除
        </el-button>
      </template> </el-table-column>
    </el-table>
    <div v-show="!listLoading" class="pagination-container">
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="cardQuery.page" :page-sizes="[10,20,30, 50]" :page-size="cardQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total"> </el-pagination>
    </div>
    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
      <el-form :model="form" :rules="rules" ref="form" label-width="100px">
        <el-form-item label="" prop="outOrderNo">
      <el-input v-model="form.outOrderNo" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="城市编码" prop="city">
      <el-input v-model="form.city" placeholder="请输入城市编码"></el-input>
    </el-form-item>
        <el-form-item label="" prop="cityCode">
      <el-input v-model="form.cityCode" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="channel">
      <el-input v-model="form.channel" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="支付宝账户ID" prop="userId">
      <el-input v-model="form.userId" placeholder="请输入支付宝账户ID"></el-input>
    </el-form-item>
        <el-form-item label="" prop="userCardType">
      <el-input v-model="form.userCardType" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="userCardNo">
      <el-input v-model="form.userCardNo" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="realName">
      <el-input v-model="form.realName" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="bankCardNo">
      <el-input v-model="form.bankCardNo" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="medicalCardNo">
      <el-input v-model="form.medicalCardNo" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="监护人卡信息" prop="relationCard">
      <el-input v-model="form.relationCard" placeholder="请输入监护人卡信息"></el-input>
    </el-form-item>
        <el-form-item label="" prop="extendParams">
      <el-input v-model="form.extendParams" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="请求时间" prop="reqTime">
      <el-input v-model="form.reqTime" placeholder="请输入请求时间"></el-input>
    </el-form-item>
        <el-form-item label="结果返回时间" prop="resultTime">
      <el-input v-model="form.resultTime" placeholder="请输入结果返回时间"></el-input>
    </el-form-item>
        <el-form-item label="S成功F失败" prop="resultStats">
      <el-input v-model="form.resultStats" placeholder="请输入S成功F失败"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultCode">
      <el-input v-model="form.resultCode" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultMessage">
      <el-input v-model="form.resultMessage" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultDescription">
      <el-input v-model="form.resultDescription" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultMedicalCardId">
      <el-input v-model="form.resultMedicalCardId" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultMedicalCardNo">
      <el-input v-model="form.resultMedicalCardNo" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultMedicalCardValidateDate">
      <el-input v-model="form.resultMedicalCardValidateDate" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultMedicalCardStatus">
      <el-input v-model="form.resultMedicalCardStatus" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultMedicalCardType">
      <el-input v-model="form.resultMedicalCardType" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultBankCardNo">
      <el-input v-model="form.resultBankCardNo" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultOutUserAccount">
      <el-input v-model="form.resultOutUserAccount" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultOutUserId">
      <el-input v-model="form.resultOutUserId" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultOutRealName">
      <el-input v-model="form.resultOutRealName" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultOutUserCardType">
      <el-input v-model="form.resultOutUserCardType" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultOutUserCardNo">
      <el-input v-model="form.resultOutUserCardNo" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultSocialCardNo">
      <el-input v-model="form.resultSocialCardNo" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="resultExtendParams">
      <el-input v-model="form.resultExtendParams" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="flg1">
      <el-input v-model="form.flg1" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="flg2">
      <el-input v-model="form.flg2" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="flg3">
      <el-input v-model="form.flg3" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="flg4">
      <el-input v-model="form.flg4" placeholder="请输入"></el-input>
    </el-form-item>
        <el-form-item label="" prop="flg5">
      <el-input v-model="form.flg5" placeholder="请输入"></el-input>
    </el-form-item>
        </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancel('form')">取 消</el-button>
        <el-button v-if="dialogStatus=='create'" type="primary" @click="create('form')">确 定</el-button>
        <el-button v-else type="primary" @click="update('form')">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import {
      page,
      addObj,
      getObj,
      delObj,
      putObj
  } from 'api/admin/cardQuery/index';
  import { mapGetters } from 'vuex';
  export default {
    name: 'cardQuery',
    data() {
      return {
        form: {
        outOrderNo : undefined,        city : undefined,        cityCode : undefined,        channel : undefined,        userId : undefined,        userCardType : undefined,        userCardNo : undefined,        realName : undefined,        bankCardNo : undefined,        medicalCardNo : undefined,        relationCard : undefined,        extendParams : undefined,        reqTime : undefined,        resultTime : undefined,        resultStats : undefined,        resultCode : undefined,        resultMessage : undefined,        resultDescription : undefined,        resultMedicalCardId : undefined,        resultMedicalCardNo : undefined,        resultMedicalCardValidateDate : undefined,        resultMedicalCardStatus : undefined,        resultMedicalCardType : undefined,        resultBankCardNo : undefined,        resultOutUserAccount : undefined,        resultOutUserId : undefined,        resultOutRealName : undefined,        resultOutUserCardType : undefined,        resultOutUserCardNo : undefined,        resultSocialCardNo : undefined,        resultExtendParams : undefined,        flg1 : undefined,        flg2 : undefined,        flg3 : undefined,        flg4 : undefined,        flg5 : undefined          },
        rules: {
  /*  outOrderNo: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   city: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   cityCode: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   channel: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   userId: [
  {
    required: true,
    message: '请输入支付宝账户ID',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   userCardType: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   userCardNo: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   realName: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   bankCardNo: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   medicalCardNo: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   relationCard: [
  {
    required: true,
    message: '请输入监护人卡信息',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   extendParams: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   reqTime: [
  {
    required: true,
    message: '请输入请求时间',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultTime: [
  {
    required: true,
    message: '请输入结果返回时间',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultStats: [
  {
    required: true,
    message: '请输入S成功F失败',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultCode: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultMessage: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultDescription: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultMedicalCardId: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultMedicalCardNo: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultMedicalCardValidateDate: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultMedicalCardStatus: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultMedicalCardType: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultBankCardNo: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultOutUserAccount: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultOutUserId: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultOutRealName: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultOutUserCardType: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultOutUserCardNo: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultSocialCardNo: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   resultExtendParams: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   flg1: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   flg2: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   flg3: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   flg4: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
],   flg5: [
  {
    required: true,
    message: '请输入',
    trigger: 'blur'
  },
  {
    min: 3,
    max: 20,
    message: '长度在 3 到 20 个字符',
    trigger: 'blur'
  }
]      */  },
        list: null,
        total: null,
        listLoading: true,
        isCheckAll: false,
        cardQuery: {
          page: 1,
          limit: 10
        },
        dialogFormVisible: false,
        dialogStatus: '',
        cardQueryManager_btn_edit: false,
        cardQueryManager_btn_del: false,
        cardQueryManager_btn_add: false,
        textMap: {
          update: '编辑',
          create: '创建'
        },
        tableKey: 0
      }
    },
    created() {
      this.getList();
      this.cardQueryManager_btn_edit = this.elements['cardQueryManager:btn_edit'];
      this.cardQueryManager_btn_del = this.elements['cardQueryManager:btn_del'];
      this.cardQueryManager_btn_add = this.elements['cardQueryManager:btn_add'];
    },
    computed: {
      ...mapGetters([
        'elements'
      ])
    },
    methods: {
      getList() {
        if(!this.isCheckAll){
         this.listLoading = false;
         }else {
        this.listLoading = false;
        page(this.cardQuery)
            .then(response => {
          this.list = response.data.rows;
        this.total = response.data.total;
        this.listLoading = false;
      })
      }},
      handleFilter() {
        this.isCheckAll=true;
        if(!this.cardQuery.userId && !this.cardQuery.city) {
          this.$message({
            message: '请至少输入一项搜索条件！',
            duration: '2000',
            type: 'warning'
          })
        return false
        } else{
        this.getList();
        }
      },
      handleSizeChange(val) {
        this.cardQuery.limit = val;
        this.getList();
      },
      handleCurrentChange(val) {
        this.cardQuery.page = val;
        this.getList();
      },
      handleCreate() {
        this.resetTemp();
        this.dialogStatus = 'create';
        this.dialogFormVisible = true;
      },
      handleUpdate(row) {
        getObj(row.id)
            .then(response => {
          this.form = response.data;
        this.dialogFormVisible = true;
        this.dialogStatus = 'update';
      });
      },
      handleDelete(row) {
        this.$confirm('此操作将永久删除, 是否继续?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            })
            .then(() => {
          delObj(row.id)
      .then(() => {
          this.$notify({
          title: '成功',
          message: '删除成功',
          type: 'success',
          duration: 2000
        });
        const index = this.list.indexOf(row);
        this.list.splice(index, 1);
      });
      });
      },
      create(formName) {
        const set = this.$refs;
        set[formName].validate(valid => {
        if (valid) {
        addObj(this.form)
        .then(() => {
        this.dialogFormVisible = false;
        this.getList();
        this.$notify({
        title: '成功',
        message: '创建成功',
        type: 'success',
        duration: 2000
        });
        })
        } else {
        return false;
        }
        });
      },
      cancel(formName) {
        this.dialogFormVisible = false;
        const set = this.$refs;
        set[formName].resetFields();
      },
      update(formName) {
        const set = this.$refs;
        set[formName].validate(valid => {
        if (valid) {
        this.dialogFormVisible = false;
        this.form.password = undefined;
        putObj(this.form.id, this.form).then(() => {
        this.dialogFormVisible = false;
        this.getList();
        this.$notify({
        title: '成功',
        message: '创建成功',
        type: 'success',
        duration: 2000
        });
        });
        } else {
        return false;
        }
        });
      },
      resetTemp() {
        this.form = {
          username: undefined,
          name: undefined,
          sex: '男',
          password: undefined,
          description: undefined
        };
      }
    }
  }
</script>
